<center>
<table width='1000'>
<tr>
	<td><h2>Newsletter</h2></td>
	<td align='right'>
		<?php if ( $accion=='listar' and ( $_SESSION['god'] == 1 or $Config['crea_categorias'] == 'S' ) ) { ?> 
       		<a href="<?php echo ADMIN;?>newsletter/news_editar.php?id=0" 
			class="btn btn-primary"  title='Crear nuevo Newsletter' >Crear nuevo Newsletter</a>
		<?php } ?>    
	</td>
</tr>
</table>

<?php
	if(!empty($_SESSION['Msg'])) {
		echo mensaje_ok($_SESSION['Msg']);
		$_SESSION['Msg']='';
	}
?>

<?php if (!empty($Noticias)) { ?>
	<table class='table table-striped table-bordered table-hover' style='width:1000px; font-size:12px;'>
		<thead>
			<tr>
				<th>ID</th>
				<th style='width:150px;max-width:150px;text-align:center;'>Acciones</th>
				<th>Update</th>
				<th>Título</th>
				<th>URL Amigable</th> 
			</tr>
		</thead>
		<tbody>

		<?php foreach($Noticias as $not) { ?>
			<tr>
				<td><?php echo $not['id'];?></td>
			

				<td align='center' nowrap="nowrap">
				
					<a href='news_editar.php?id=<?php echo $not['id'];?>'
						title='Editar esta publicación' class='btn btn-warning btn-sm'><i class="fa fa-pencil-square-o"></i></a>

					<a href='index.php?accion=delete&id=<?php echo $not['id'];?>'
						title='Eliminar esta publicación' class='btn btn-danger btn-sm'
						onclick="return confirm('Est&aacute; seguro de eliminar esta publicaci&oacute;n?\n <?php echo $not['titulo'];?>');">
						<i class="fa fa-trash-o"></i></a>

					<?php if ($not['activo']==1) { $class="btn btn-success btn-sm"; } else {$class="btn btn-default btn-sm";} ?>
					<a href='#' class='<?php echo $class;?>' title='Activar/Desactivar esta publicaci&oacute;n'
					onclick="javascript:cambiar_estado('newsletter','activo','id','<?php echo $not['id'];?>');" 
					 id='newsletter_activo_<?php echo $not['id'];?>'><i class="fa fa-check-square-o"></i></a>
					
					<a href='<?php echo URL;?>/newsletter/<?php echo $not['urlamigable'];?>.html' target='_news'
						class='btn btn-info btn-sm' title='Ver Newsletter'><i class="fa fa-search"></i></a>

					<a href='<?php echo ADMIN;?>newsletter/campaign_editar.php?id=0&news_id=<?php echo $not['id'];?>'
						class='btn btn-default btn-sm' title='Crear Campaña'><i class="fa fa-envelope-o"></i></a>
					
				</td>
                <td nowrap='nowrap'><?php echo date("d-m-Y",$not['modificado']);?></td>
				<td nowrap="nowrap"><?php echo $not['titulo'];?></td>
				<td ><?php echo $not['urlamigable'];?></td>
			</tr>
		<?php } ?>

	</table>
<?php } else { ?>
	<span class='titulo'>No hay Contenidos para mostrar</span>
<?php } ?>

